package com.haimi.shiguang.utils;

import android.graphics.Paint;
import android.widget.TextView;

/**
 * @ClassName: TextUtil
 * @Description:
 * @author: SugarT
 * @date: 2017/7/26 下午3:01
 */
public class TextUtil {

    /**
     * TextView 添加中划线
     * @param textView
     */
    public static void addLine(TextView textView) {
        textView.getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG | Paint.ANTI_ALIAS_FLAG); // 设置中划线并加清晰
        textView.getPaint().setAntiAlias(true);// 抗锯齿
    }

    public static void addLine(TextView... args) {
        for (TextView arg : args) {
            addLine(arg);
        }
    }

    /**
     * TextView 移除中划线
     * @param textView
     */
    public static void removeLine(TextView textView) {
        textView.getPaint().setFlags(0); // 取消设置的的划线
        textView.getPaint().setAntiAlias(true);// 抗锯齿
    }

    public static void removeLine(TextView... args) {
        for (TextView arg : args) {
            removeLine(arg);
        }
    }
}
